package com.xinruke.hostels.dailymanage.controller;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.dailymanage.interfaces.dto.inhotel.TeamInHotelDTO;
import com.xinruke.hostels.dailymanage.interfaces.dto.inhotel.TeamInHotelResultDTO;
import com.xinruke.hostels.dailymanage.service.TeamRoomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @ClassName TeamRoomController
 * @CreateDate 2019/7/15
 * @Author FengXinQiang
 * @Version V1.0.0.0
 * @Decription 团队房间Controller
 */
@RestController
@RequestMapping("/team/room/")
@Api(tags = "团队房间")
@Slf4j
public class TeamRoomController extends BaseController {
    @Autowired
    TeamRoomService teamRoomService;

    @PostMapping("/inHotel")
    @ApiOperation("入住")
    public ResultVO<TeamInHotelResultDTO> inHotel(@RequestBody @Valid TeamInHotelDTO teamInHotelDTO) {
        ResultVO<TeamInHotelResultDTO> resultVO = ResultVO.fail();

        resultVO = teamRoomService.inHotel(teamInHotelDTO);

        return resultVO;
    }

}
